(function(){
  var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
 
  // The base Class implementation (does nothing)
  this.Class = function(){};
 
  // Create a new Class that inherits from this class
  Class.extend = function(prop) {
    var _super = this.prototype;
   
    // Instantiate a base class (but only create the instance,
    // don't run the init constructor)
    initializing = true;
    var prototype = new this();
    initializing = false;
   
    // Copy the properties over onto the new prototype
    for (var name in prop) {
      // Check if we're overwriting an existing function
      prototype[name] = typeof prop[name] == "function" &&
        typeof _super[name] == "function" && fnTest.test(prop[name]) ?
        (function(name, fn){
          return function() {
            var tmp = this._super;
           
            // Add a new ._super() method that is the same method
            // but on the super-class
            this._super = _super[name];
           
            // The method only need to be bound temporarily, so we
            // remove it when we're done executing
            var ret = fn.apply(this, arguments);        
            this._super = tmp;
           
            return ret;
          };
        })(name, prop[name]) :
        prop[name];
    }
   
    // The dummy class constructor
    function Class() {
      // All construction is actually done in the init method
      if ( !initializing && this.init )
        this.init.apply(this, arguments);
    }
   
    // Populate our constructed prototype object
    Class.prototype = prototype;
   
    // Enforce the constructor to be what we expect
    Class.prototype.constructor = Class;
 
    // And make this class extendable
    Class.extend = arguments.callee;
   
    return Class;
  };
})();
var winHeight = screen.height;
(function(a){a.fn.scrollLoading=function(b){var c={attr:"lazyload",container:a(window),callback:a.noop};var d=a.extend({},c,b||{});d.cache=[];a(this).each(function(){var h=this.nodeName.toLowerCase(),g=a(this).attr(d.attr);var i={obj:a(this),tag:h,url:g};d.cache.push(i)});var f=function(g){if(a.isFunction(d.callback)){d.callback.call(g.get(0))}};var e=function(){var /*g=d.container.height()*/g=winHeight;if(d.container.get(0)===window){contop=a(window).scrollTop()}else{contop=d.container.offset().top}a.each(d.cache,function(m,n){var p=n.obj,j=n.tag,k=n.url,l,h;if(p){l=p.offset().top-contop,h=l+p.height();if((l>=0&&l<g)||(h>0&&h<=g)){if(k){if(j==="img"){f(p.attr("src",k))}else{p.load(k,{},function(){f(p)})}}else{f(p)}n.obj=null}}})};e();d.container.bind("scroll",e)}})(jQuery);
var KZ = KZ || {};
KZ = {
	init:function(){
	  	
	},
	cookie:{
		get:function(_name){
			var	cookies = document.cookie, pos = cookies.indexOf(_name+'='), value;
			if(pos !== -1){
				var start = pos + _name.length+1;
				var end = cookies.indexOf(';',start);
				//最后一个
				if(end === -1){end = cookies.length;}
				value = cookies.substring(start,end);
				value = decodeURIComponent(value);
			}
			return value;
		},
		set:function(_name,_value){
			document.cookie = _name+'='+encodeURIComponent(_value);
		},
		clearcookie:function(_name){
			document.cookie = _name+"=;expires="+(new Date(0)).toGMTString();
		}
	},
	session:{
		get:function(_name){
			return window.sessionStorage.getItem(_name);
		},
		set:function(_name,_value){
			window.sessionStorage.setItem(_name, _value);
		},
		remove:function(_name){
			window.sessionStorage.removeItem(_name);
		},
		clear:function(){
			window.sessionStorage.clear();
		},
		getAll:function(){
			return window.sessionStorage;
		},
		isExist:function(_name){
			if(window.sessionStorage.getItem(_name)){
				return true;
			}else{
				return false;
			}
		}
	},
    form: {
        //透视提示
        Prompt: function(text, num) {
            var html = $('<div class="kz_tishi" style="position:absolute;z-index:9999;"/>').html(text)
            if ($(".kz_tishi").length == 0) {
                html.appendTo("body").delay(1500).fadeOut(500, function() { $(this).remove(); })
                html.css({
                    left: num == 1 ? ($(window).width() - html.outerWidth()) / 2 : 0,
                    top: num == 1 ? ($(window).height() - html.outerHeight()) / 2 : 0,
                    "width": num == 1 ? "auto" : "100%",
                    "position": "fixed"
                })
            }
        }
    },
   pageLock:{
				show:function(index,ceng,colse){
					var $width=($(window).width()-$(ceng).outerWidth())/2
					var $height=($(window).height()-$(ceng).outerHeight())/2
				 if(!$("#lockpage").length){
					var lockhtml=$("<div id='lockpage'/>").css({position:"absolute",zIndex:(index?index:20),left:0,top:0,width:'100%',height:$(document).height(),background:"#000",opacity:0.3}).appendTo("body");
					}
					$("#lockpage").css({zIndex:index?index:20,opacity:0,display:"block"}).css({opacity:0.8});
				    $(ceng).css({position:"fixed",zIndex:index+1,left:$width,top:$height,display:"block"});
					KZ.pageLock.Lock_screen()
					KZ.pageLock.hide(colse,ceng)
				},
				hide:function(colse,ceng){
					 $(colse).click(function(e){
						   $(ceng).hide();
						   $("#lockpage").remove()
						   e.stopPropagation();
						   $("body")[0].ontouchmove=function(){
               };
						   return false
					});
				},
				reHide:function(ceng){
					  $("#lockpage").remove();
					  $(ceng).hide();
					   $("body")[0].ontouchmove=function(){
               };
						return false
				},
				Lock_screen:function(){
					$("body")[0].ontouchmove=function(){
						return false;
					};
				}
	},
   
}
function is_weixn(){
    var ua = navigator.userAgent.toLowerCase();
    if(ua.match(/MicroMessenger/i)=="micromessenger") {
        return true;
    } else {
        return false;
    }
}
function is_app(){
    var ua = navigator.userAgent.toLowerCase();
    if(ua.match(/Hippo/i)=="hippo") {
        return true;
    } else {
        return false;
    }
}
$(function(){
  KZ.init()	
})